<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Unregister a global variable from the current session</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="function.session-status.html">session_status</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="function.session-unset.html">session_unset</a></div>
 <div class="up"><a href="ref.session.html">Session 函数</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="function.session-unregister" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">session_unregister</h1>
  <p class="verinfo">(PHP 4, PHP 5 &lt; 5.4.0)</p><p class="refpurpose"><span class="refname">session_unregister</span> &mdash; <span class="dc-title">Unregister a global variable from the current session</span></p>

 </div>
 
 <div class="refsect1 description" id="refsect1-function.session-unregister-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="type">bool</span> <span class="methodname"><strong>session_unregister</strong></span>
    ( <span class="methodparam"><span class="type">string</span> <code class="parameter">$name</code></span>
   )</div>

  <p class="para rdfs-comment">
   <span class="function"><strong>session_unregister()</strong></span> unregisters the global variable
   named <em><code class="parameter">name</code></em> from the current session.
  </p>
  <div class="warning"><strong class="warning">Warning</strong><p class="simpara">本函数已自 PHP 5.3.0 起<em class="emphasis">废弃</em>并将自
PHP 5.4.0 起<em class="emphasis">移除</em>。</p></div>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.session-unregister-parameters">
  <h3 class="title">参数</h3>
  <p class="para">
   <dl>

    
     <dt>
<em><code class="parameter">name</code></em></dt>

     <dd>

      <p class="para">
       The variable name.
      </p>
     </dd>

    
   </dl>

  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.session-unregister-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   成功时返回 <strong><code>TRUE</code></strong>， 或者在失败时返回 <strong><code>FALSE</code></strong>。
  </p>
 </div>


 <div class="refsect1 notes" id="refsect1-function.session-unregister-notes">
  <h3 class="title">注释</h3>
  <blockquote class="note"><p><strong class="note">Note</strong>: 
   <p class="para">
    If <var class="varname"><var class="varname"><a href="reserved.variables.session.html" class="classname">$_SESSION</a></var></var> (or <var class="varname"><var class="varname">$HTTP_SESSION_VARS</var></var>
    for PHP 4.0.6 or less) is used, use <span class="function"><a href="function.unset.html" class="function">unset()</a></span> to
    unregister a session variable. Do not <span class="function"><a href="function.unset.html" class="function">unset()</a></span>
    <var class="varname"><var class="varname"><a href="reserved.variables.session.html" class="classname">$_SESSION</a></var></var> itself as this will disable the special
    function of the <var class="varname"><var class="varname"><a href="reserved.variables.session.html" class="classname">$_SESSION</a></var></var> superglobal.
   </p>
  </p></blockquote>
  <div class="caution"><strong class="caution">Caution</strong>
   <p class="para">
    This function does not unset the corresponding global variable for
    <em><code class="parameter">name</code></em>, it only prevents the variable from being
    saved as part of the session. You must call <span class="function"><a href="function.unset.html" class="function">unset()</a></span>
    to remove the corresponding global variable.
   </p>
  </div>
  <div class="caution"><strong class="caution">Caution</strong>
   <p class="para">
    If you are using <var class="varname"><var class="varname"><a href="reserved.variables.session.html" class="classname">$_SESSION</a></var></var> (or
    <var class="varname"><var class="varname">$HTTP_SESSION_VARS</var></var>), do not use
    <span class="function"><a href="function.session-register.html" class="function">session_register()</a></span>,
    <span class="function"><a href="function.session-is-registered.html" class="function">session_is_registered()</a></span> and
    <span class="function"><strong>session_unregister()</strong></span>.
   </p>
  </div>
 </div>


</div><hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="function.session-status.html">session_status</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="function.session-unset.html">session_unset</a></div>
 <div class="up"><a href="ref.session.html">Session 函数</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>
